import { User } from "src/user/entities/user.entity";
import { Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from "typeorm";

@Entity()
export class Note {
    // 主键，自动生成
    @PrimaryGeneratedColumn()
    _id: number;
  
    // 笔记标题字段
    @Column()
    title: string;
  
    // 笔记内容字段
    @Column()
    content: string;

    @ManyToOne(()=>User,user=>user.note)
    @JoinColumn()
    user:User[]
}
